using Rsd.Dudu;
using Rsd.Dudu.ModelProvider;
using Rsd.Dudu.ORM;
using Rsd.Faith.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Rsd.Faith.Models
{

    /// <summary>
    /// 利息收益流程:
    /// 
    /// 每个所属期期初登记分户存款,
    /// 期末核算分户利息金额,
    /// 将增值收益派息到小区

    /// 小区将利息分派到楼栋统筹账户
    /// 小区将利息分派到统筹单元账户
    /// 小区将利息分派到分户账
    /// 
    ///  一个小区的增值余额为:小区统筹账户余额+楼栋统筹账户余额+单元统筹账户余额
    ///  
    /// </summary>
    [TablePartitioner("suo_shu_qi", "按所属期分表存储")]
    [Table("bank_应收利息", "bank__fenhu_shou_yi_biao", "id")]
    [Serializable]
    public class BankFenHuShouYiBiaoModel : Rsd.Faith.Core.ModelBase
    {

        /// <summary>
        /// 账户编号
        /// </summary>
        [TableIndex(TableIndexType.Normal, TableIndexUsing.BTree)]
        [StringType("zhang_hu_bian_hao", "分户账户编号", 20, 50)]
        [DisplayName("分户账户编号")]
        public string ZhangHuBianHao { get; set; }

        /// <summary>
        /// 小区编号
        /// </summary>
        [TableIndex(TableIndexType.Normal, TableIndexUsing.Hash)]
        [StringType("xiao_qu_bian_hao", "小区编号", 21, 20)]
        [DisplayName("小区编号")]
        public string XiaoQuBianHao { get; set; }

        /// <summary>
        /// 房屋编号
        /// </summary>
        [TableIndex(TableIndexType.Normal, TableIndexUsing.BTree)]
        [StringType("fang_wu_bian_hao", "房屋编号", 22, 50)]
        [DisplayName("房屋编号")]
        public string FangWuBianHao { get; set; }

        /// <summary>
        /// 收益来源账户
        /// </summary>
        [StringType("suo_shu_qi", "所属期", 23, 255)]
        [DisplayName("所属期")]
        public string SuoShuQi { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        [DateTimeFormat("yyyy-MM-dd")]
        [DateTimeType("kai_shi_ri_qi", "开始日期", 24, 3)]
        [DisplayName("开始日期")]
        public DateTime KaiShiRiQi { get; set; }

        /// <summary>
        /// 结束日期 
        /// </summary>
        [DateTimeFormat("yyyy-MM-dd")]
        [DateTimeType("jie_shu_ri_qi", "结束日期", 25,3)]
        [DisplayName("结束日期")]
        public DateTime JieShuRiQi { get; set; }

        /// <summary>
        /// 期初本金
        /// </summary>
        [NumericType("qi_chu_ben_jin", "期初本金", 26, 20, 2)]
        [DisplayName("期初本金")]
        public decimal QiChuBenJin { get; set; }

        /// <summary>
        /// 定期年利率
        /// </summary>
        [NumericType("ding_qi_li_lv", "定期年利率", 27, 10, 3)]
        [DisplayName("定期年利率")]
        public decimal DingQiLiLv { get; set; }

        /// <summary>
        /// 活期年利率
        /// </summary>
        [NumericType("huo_qi_li_lv", "活期年利率", 28, 10, 3)]
        [DisplayName("活期年利率")]
        public decimal HuoQiLiLv { get; set; }

        /// <summary>
        /// 定期利息(%)
        /// </summary>
        [IntegerType("ding_cun_bi_lv", "定存比例(%)", 30, 10, 80)]
        [DisplayName("定存比例(%)")]
        public int DingCunBiLv { get; set; }

        /// <summary>
        /// 定期利息
        /// </summary>
        [NumericType("ding_qi_li_xi", "定期利息", 32, 10, 2)]
        [DisplayName("定期利息")]
        public decimal DingQiLiXi { get; set; }

        /// <summary>
        /// 活期利息
        /// </summary>
        [NumericType("huo_qi_li_xi", "活期利息", 34, 10, 2)]
        [DisplayName("活期利息")]
        public decimal HuoQiLiXi { get; set; }

        /// <summary>
        /// 活期利息速算扣除
        /// </summary>
        [NumericType("huo_qi_li_xi_kc", "活期利息速算扣除", 35, 10, 2)]
        [DisplayName("活期利息速算扣除")]
        public decimal HuoQiLiXiKouChu { get; set; }

        /// <summary>
        /// 利息合计 
        /// </summary>
        [NumericType("li_xi_he_ji", "利息合计", 36, 10, 2)]
        [DisplayName("利息息计")]
        public decimal LiXiHeJi { get; set; }

      
        /// <summary>
        /// 已登记,已结息,已入楼栋账,已入单元账,已入分户账
        /// </summary>
        [StringType("zhuang_tai", "状态", 40, 10,"DJ")]
        [DisplayName("状态")]
        public LiXiShouYiZhuangTai ZhuangTai { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public BankFenHuShouYiBiaoModel()
        {
            
        }

    }
    
}
